function loginCtrl($scope, $http) {
  $scope.password = '';
  $scope.username = '';
  $scope.login = function () {
    $scope.user = {username: $scope.username, password: $scope.password};
    $http.post('/login', $scope.user)
    .then((data) => {
      console.log(data);
    }, (err) => {
      console.log(err);
    });
  };
}
loginCtrl.$inject = ['$scope', '$http'];

module.exports = loginCtrl;
